package open3366pvp.as3.dataStruct
{
	import flash.utils.ByteArray;
	
	import open3366pvp.as3.Open3366PvpEvent;
	
	/**
	 * 获取某个房间的详细信息
	 * @author mandyxiong
	 * 
	 */	
	public class OneRoomProp implements IPvpInfo
	{
		public var gameId:uint;
		public var uid:String;
		public var zoneId:int;
		public var roomId:int;
		public var info:RoomInfo;
		
		public function parasData(data:ByteArray):void
		{
			uid = data.readUTFBytes(32);
			gameId = data.readUnsignedInt();
			zoneId = data.readInt();
			roomId = data.readInt();
			info = new RoomInfo(data);
		}
		
		public function get eventType():String
		{
			return Open3366PvpEvent.GET_ROOM_INFO;
		}
		
		public function toString():String
		{
			var str:String = "uid :" + uid + ", gameId" + gameId + ", zoneId" + zoneId + ", roomId" + roomId + "\n";
			
			str += ("roomId:" + info.roomId + ", userTotalCount:" + info.roomUserTotalCount +  ", userNotInTableCount: " + info.roomUserNotInTableCount + ", bufferSize:" + info.bufferSize + ", bufferContent:" + info.bufferData.toString() + ";");
			
			return "获取游戏单个房间成功！！\n" + str;
		}
	}
}